<form nz-form [formGroup]="addForm" class="modal-add-form" (ngSubmit)="onSubmit($event)">
    <nz-form-item>
        @if (editMode == modeEnum.ADD) {
            <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="groupType" nzRequired>组类型</nz-form-label>
        } @else {
            <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="groupType">组类型</nz-form-label>
        }
        <nz-form-control [nzSm]="14" [nzXs]="24">
            <input class="default-input" nz-input formControlName="groupType" placeholder="字母数字下划线" />
            <div *ngIf="submitted && fm['groupType'].invalid" class="alert">
                <div *ngIf="fm['groupType'].errors?.['rquired']">请输入组类型</div>
                <div *ngIf="fm['groupType'].errors?.['minlength']">组类型不少于2个字</div>
                <div *ngIf="fm['groupType'].errors?.['maxlength']">组类型不超过20个字</div>
            </div>

        </nz-form-control>
    </nz-form-item>

    <nz-form-item>
        @if (editMode == modeEnum.ADD) {
            <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="dictLabel" nzRequired>标签名</nz-form-label>
        } @else {
            <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="dictLabel">标签名</nz-form-label>
        }
        <nz-form-control [nzSm]="14" [nzXs]="24">
            <input class="default-input" nz-input formControlName="dictLabel" placeholder="标签名" />
            <div *ngIf="submitted && fm['dictLabel'].invalid" class="alert">
                <div *ngIf="fm['dictLabel'].errors?.['rquired']">请输入组标签</div>
                <div *ngIf="fm['dictLabel'].errors?.['minlength']">组标签不少于2个字</div>
                <div *ngIf="fm['dictLabel'].errors?.['maxlength']">组标签不超过20个字</div>
            </div>
        </nz-form-control>
    </nz-form-item>

    <nz-form-item>
        <nz-form-label [nzSm]="6" [nzXs]="24" nzFor="remark">描述</nz-form-label>
        <nz-form-control [nzSm]="14" [nzXs]="24">
            <textarea class="default-input" rows="4" nz-input formControlName="remark" placeholder=""></textarea>
            <div *ngIf="submitted && fm['remark'].invalid" class="alert">
                <div *ngIf="fm['remark'].errors?.['maxlength']">组标签不超过1024个字</div>
            </div>
        </nz-form-control>
    </nz-form-item>

    <div nz-row nzJustify="end" class="action-area">
        <div nz-col>
            <button class="action-button" nz-button [nzType]="'primary'">添加</button>
            <button class="action-button" nz-button (click)="onCancel($event)">取消</button>
        </div>
    </div>
</form>